home *** CD-ROM | disk | FTP | other *** search
/ Univers Interactif 3 / INTERACTIF.BIN / pc / planeten / internet / machttp2.sit / MacHTTP 2.0 / MacHTTP Software & Docs / Tutorials / Examples / test.script < prev    next >
Text File  |  1994-11-27  |  2KB  |  37 lines

  1. -- Variables available for use:
  2. -- http_search_args - stuff in the URL after a ?
  3. -- post_args - stuff in the URL after a $
  4. -- method - GET, POST, etc. Used to tell if post_args are valid
  5. -- client_address - IP address or domain name of remote client's host
  6. -- from_user - non-standard. e-mail address of remote user
  7. -- username - authenticated user name
  8. -- password - authenticated password
  9. -- server_name - name or IP address of this server
  10. -- server_port - TCP/IP port number being used by this server
  11. -- script_name - URL name of this script
  12. -- referer - the URL of the page referencing this document
  13. -- user_agent - the name and version of the WWW client software being used
  14. -- content_type - MIME content type of post_args
  15.  
  16. set crlf to (ASCII character 13) & (ASCII character 10)
  17.  
  18. --this builds the normal HTTP header for regular access
  19. set http_10_header to "HTTP/1.0 200 OK" & crlf & "Server: MacHTTP" & crlf & ┬
  20.     "MIME-Version: 1.0" & crlf & "Content-type: text/html" & crlf & crlf
  21.  
  22. return http_10_header & "<title>Test SCRIPT</title><h2>Test SCRIPT</h2><u>SCRIPT arguments sent:</u>" & ┬
  23.     "<br><b>path:</b> " & path_args & ┬
  24.     "<br><b>search:</b> " & http_search_args & ┬
  25.     "<br><b>post_args:</b> " & post_args & ┬
  26.     "<br><b>method:</b> " & method & ┬
  27.     "<br><b>address:</b> " & client_address & ┬
  28.     "<br><b>user:</b> " & username & ┬
  29.     "<br><b>password:</b> " & password & ┬
  30.     "<br><b>from:</b> " & from_user & ┬
  31.     "<br><b>server_name:</b> " & server_name & ┬
  32.     "<br><b>server_port:</b> " & server_port & ┬
  33.     "<br><b>script_name:</b> " & script_name & ┬
  34.     "<br><b>referer:</b> " & referer & ┬
  35.     "<br><b>user agent:</b> " & user_agent & ┬
  36.     "<br><b>content_type:</b> " & content_type & crlf
  37.